<template>
	<view class="page">
		<view class="list">
			<view  class="list-item" >
				<uni-list :border="false" >
					<uni-list-item  :isBorder="true" :extraIcon="extraIcon" showExtraIcon="true" >
						<view  class="list-item-column" >
							<view v-if="orderCourier.status==0" class="slot-box">
								<text class="slot-text">本单收入：{{orderCourier.schoolOrderCommission}}</text>
							</view>
							<view v-if="orderCourier.status==1" class="slot-box">
								<text class="slot-text">付款金额：{{orderCourier.schoolOrderPayAmount}}</text>
							</view>
							<text class="uni-list-item__content-note">下单时间：{{orderCourier.schoolOrderPlaceOrderTime}}</text>
						</view>
					</uni-list-item>
					<uni-list-item  :isBorder="true" :extraIcon="{color: '#00aa7f',size: 50,type: 'iconjikuaidi'}" showExtraIcon="true" >
						<view  class="list-item-column" >
							<view class="">
								包裹大小
							</view>
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.schoolOrderParcel}}</text>
							</view>
						</view>
					</uni-list-item>
					<uni-list-item  :isBorder="true" :extraIcon="{color: '#00aa7f',size: 50,type: 'iconjikuaidi'}" showExtraIcon="true" >
						<view  class="list-item-column" >
							<view class="">
								取件码
							</view>
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.schoolOrderNotes}}</text>
							</view>
						</view>
					</uni-list-item>
					<uni-list-item  :isBorder="true" :extraIcon="extraIcon1" showExtraIcon="true" >
						<view  class="list-item-column" >
							<view class="">
								取货地址
							</view>
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.schoolOrderPlace}}</text>
							</view>
						</view>
						<view slot="right">
							<zywork-icon  type="iconditu" color="#00aa7f" :size="50" />
						</view>
					</uni-list-item>
					<uni-list-item  :isBorder="true" :extraIcon="extraIcon2"  showExtraIcon="true">
						<view  class="zy-phone" >
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.schoolOrderAddressRealName}}</text>
								<text class="slot-text" style="margin-left: 10rpx;">{{orderCourier.schoolOrderAddressPhone}}</text>
							</view>
							<text class="uni-list-item__content-note">{{orderCourier.schoolOrderAddressSchool}}{{orderCourier.schoolOrderAddressStoriedBuilding}}{{orderCourier.schoolOrderAddressArea}}</text>
						</view>
						<view v-show="orderCourier.status==0" slot="right" @click.stop="callPhone(orderCourier.schoolOrderAddressPhone)">
							<zywork-icon  type="icontelephone" color="#ffaa00" :size="70"  />
						</view>
					</uni-list-item>
					<uni-list-item  :isBorder="true" :extraIcon="{color: '#ffaa00',size: 50,type: 'iconshijian'}" showExtraIcon="true" >
						<view  class="list-item-column" >
							<view class="">
								送达时间
							</view>
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.schoolOrderDelivery}}</text>
							</view>
						</view>
					</uni-list-item>
					<uni-list-item v-show="orderCourier.status==1&&orderCourier.schoolOrderStatus>0"  :isBorder="true" :extraIcon="{color: '#ffaa00',size: 50,type: 'iconshijian'}" showExtraIcon="true" >
						<view  class="list-item-column" >
							<view class="">
								骑手电话
							</view>
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.userPhone}}</text>
							</view>
						</view>
						<view  slot="right" @click.stop="callPhone(orderCourier.userPhone)">
							<zywork-icon  type="icontelephone" color="#ffaa00" :size="70"  />
						</view>
					</uni-list-item>
					<uni-list-item  :isBorder="false" :extraIcon="{color: '#ffb907',size: 50,type: 'iconicon'}"  showExtraIcon="true">
						<view  class="list-item-column" >
							<view class="">
								订单号
							</view>
							<view class="slot-box">
								<text class="slot-text">{{orderCourier.schoolOrderId}}</text>
							</view>
						</view>
					</uni-list-item>
					<view v-if="orderCourier.schoolOrderStatus==3" class="add-order-btn" style="background-color: #ff6233;">
						已送达
					</view>
				</uni-list>
			</view>
		</view>
	</view>
</template>

<script>
	import uniList from '@/components/uni-list/uni-list.vue'
	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
	import zyworkIcon from '@/components/zywork-icon/zywork-icon.vue'
	import * as ResponseStatus from '@/common/response-status.js'
	import {
		showInfoToast,
		doGet,
		doPostJson,
		MY_SHARE_CODE,
		SHARE_CODE_PAGE_IMG,
		SHARE_TITLE,
		SHARE_CODE,
		FRONT_BASE_URL,
		LOCAL_FILE_STORAGE,
		USER_ROLES,
		USER_ID,
		USER_NICKNAME,
		USER_HEADICON,
		HOST_ROOM_INFO
		
	} from '@/common/util.js'
	export default {
		components: {
			zyworkIcon,
			uniList,
			uniListItem
		},
		data() {
			return {
				extraIcon: {
					color: '#ffcc00',
					size: 50,
					type: 'iconshouru'
				},
				extraIcon1: {
					color: '#00aa7f',
					size: 50,
					type: 'iconquzhong'
				},
				extraIcon2: {
					color: '#ff5500',
					size: 50,
					type: 'iconsong'
				},
				orderCourier:{},
				status:0   //0代表骑手查看详情,1代表用户查看详情 骑手查看的时候可以直接拨打用户电话，用户查看的时候可以直接拨打骑手电话
			};
		},
		onLoad(option){
			if(option.orderCourier){
				var orderCourier = JSON.parse(option.orderCourier); // 字符串转对象
				this.orderCourier = orderCourier
				console.log(this.orderCourier)
			}
		},
		methods:{
			callPhone(phone) {
				uni.makePhoneCall({
					phoneNumber: phone + '',
					success: () => {
						
					},
					// 失败回调
					fail: (res) => {
						console.log(res);
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	@import '@/common/zywork-main.scss';
	.page{
		width: 100%;
		height: 100%;
		background-color: #f4f4f4;
	}
	.zy-phone{
		@include flex-center-column;
	}
	.list{
		@include flex-center-column;
		@include padding;
		background-color: #f4f4f4;
		align-items: center;
		.list-item{
			padding: 10rpx 10rpx;
			margin: 10rpx 0rpx;
			width: 100%;
			border-radius: 35rpx;
			border: solid 1rpx #EEEEEE;
			background-color: $primary-backcolor;
			.list-item-column{
				@include flex-center-column;
			}
			.add-order-btn{
				margin: 20rpx auto;
				width: 260rpx;
				height: 80rpx;
				line-height: 80rpx;
				background: #ffaa00;
				text-align: center;
				border-radius: 15rpx;
				color: $primary-color;
			}
			
		}
		
	}
	.slot-box {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		padding: 10rpx 0rpx;
	}
	.slot-text{
		color: #3b4144;
		font-size: $font-base;
	}
</style>
